package com.jilefojing.service;

import java.util.List;

import com.jilefojing.beans.enums.ProgressStatusForSource;
import com.jilefojing.beans.exception.UserContextException;
import com.jilefojing.beans.pojos.EAudio;
import com.jilefojing.beans.pojos.enhanced.EnhancedDCategory;
import com.jilefojing.beans.pojos.enhanced.EnhancedEAudio;
import com.jilefojing.beans.pojos.enhanced.base.BaseEnhanced;
import com.jilefojing.beans.query.EAudioQuery;
import com.jilefojing.beans.vo.Pagination;
import com.jilefojing.beans.vo.UploadFile;
import com.jilefojing.context.beans.vo.UserContext;
import com.jilefojing.service.base.IBaseService;

/**
 * 
 * @author 作者 jgshun
 * @date 创建时间 2016年07月19日 13时23分08秒
 */
public interface IEAudioService extends IBaseService<EAudio> {

	/**
	 * 取类别的交集
	 * 
	 * @param categoryIds
	 * @param progressStatuses
	 * @param pagination
	 * @param userContext
	 * @return
	 */
	Pagination<EnhancedEAudio> getPaginationByCategoryIdsForActive(List<Long> categoryIds, List<ProgressStatusForSource> progressStatuses, Pagination<EnhancedEAudio> pagination,
			UserContext userContext);

	Pagination<EnhancedEAudio> getPaginationByTagIdForActive(long tagId, Pagination<EnhancedEAudio> pagination, UserContext userContext);

	Pagination<EnhancedEAudio> getPagination(EAudioQuery eVideoQuery, Pagination<EnhancedEAudio> pagination, UserContext userContext);

	List<? extends BaseEnhanced> getEnhanceds(List<Long> ids, UserContext userContext);

	List<EnhancedEAudio> getEnhancedsNotAppend(List<Long> ids, UserContext userContext);

	EnhancedEAudio appendEnhancedStatistics(EnhancedEAudio enhancedEAudio, UserContext userContext);

	List<EnhancedEAudio> appendEnhancedStatistics(List<EnhancedEAudio> enhancedEAudios, UserContext userContext);

	EnhancedEAudio appendEnhancedParent(EnhancedEAudio enhancedEAudio, UserContext userContext);

	List<EnhancedEAudio> appendEnhancedParent(List<EnhancedEAudio> enhancedEAudios, UserContext userContext);

	EnhancedEAudio appendEnhancedChildren(EnhancedEAudio enhancedEAudio, UserContext userContext);

	List<EnhancedEAudio> appendEnhancedChildren(List<EnhancedEAudio> enhancedEAudios, UserContext userContext);

	EnhancedEAudio appendCountCognate(EnhancedEAudio enhancedEAudio, UserContext userContext);

	List<EnhancedEAudio> appendCountCognate(List<EnhancedEAudio> enhancedEAudios, UserContext userContext);

	List<EnhancedEAudio> getEnhancedsByParentId(long parentId, UserContext userContext);

	List<EnhancedEAudio> getEnhancedsByParentIds(List<Long> parentIds, UserContext userContext);

	List<EnhancedEAudio> appendCountCognatePlaytime(List<EnhancedEAudio> enhancedEAudios, UserContext userContext);

	EnhancedEAudio getEnhancedForActive(long id, UserContext userContext) throws UserContextException;

	EnhancedEAudio appendEnhancedUsers(EnhancedEAudio enhancedEAudio, UserContext userContext);

	List<EnhancedEAudio> appendEnhancedUsers(List<EnhancedEAudio> enhancedEAudios, UserContext userContext);

	EnhancedEAudio appendEnhancedAttitudeForUser(EnhancedEAudio enhancedEAudio, UserContext userContext);

	List<EnhancedEAudio> appendEnhancedAttitudeForUser(List<EnhancedEAudio> enhancedEAudios, UserContext userContext);

	EnhancedEAudio appendEnhancedRFavoriteSourceForUser(EnhancedEAudio enhancedEAudio, UserContext userContext);

	List<EnhancedEAudio> appendEnhancedRFavoriteSourceForUser(List<EnhancedEAudio> enhancedEAudios, UserContext userContext);

	EnhancedEAudio appendEnhancedTags(EnhancedEAudio enhancedEAudio, UserContext userContext);

	List<EnhancedEAudio> appendEnhancedTags(List<EnhancedEAudio> enhancedEAudios, UserContext userContext);

	List<EnhancedDCategory> getEnhancedDCategories(UserContext userContext);

	/**
	 * 上传视频源
	 * 
	 * @param eVideo
	 * @param userContext
	 * @return
	 * @throws UserContextException
	 */
	EAudio add(EAudio eVideo, UserContext userContext) throws UserContextException;

	/**
	 * 只更新 title sort playtime summary info status progressStatus
	 * 
	 * @param eVideo
	 * @param userContext
	 * @return
	 * @throws UserContextException
	 */
	EAudio update(EAudio eVideo, UserContext userContext) throws UserContextException;

	/**
	 * 只更新封面
	 * 
	 * @param id
	 * @param coverUploadFile
	 * @param userContext
	 * @return
	 * @throws UserContextException
	 */
	EAudio updateCover(long id, UploadFile coverUploadFile, UserContext userContext) throws UserContextException;

	/**
	 * 
	 * @param childId
	 * @param parentId
	 * @param optype
	 *            true增加关系 false删除关系
	 * @param userContext
	 * @return
	 */
	EAudio updateRelation(long childId, long parentId, boolean optype, UserContext userContext) throws UserContextException;

}
